package com.xhtech.base.service.preview.data

import android.graphics.RectF
import com.xhtech.base.service.preview.PreviewType

/**
 * @author yuanxh
 * @date :2023/9/2 8:47
 * @description: 预览信息
 */
data class PreviewInfo(@PreviewType val type: Int, var index: Int = 0, val rectF: RectF? = null) {

    var thumbnailUrl: String = ""

    var originalUrl: String = ""

    var playerUrl: String = ""

    var faceWidth: Float = 0f

    var faceHeight: Float = 0f

    /**宽高比*/
    fun ratio() = if (faceWidth <= 0f || faceHeight <= 0f) 1 else faceWidth / faceHeight

    /**
     * @return 返回需要展示的地址，如果已经查看原图或者下载当展示本地地址
     * */
    fun getCoverPath() = thumbnailUrl
}